<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link type="text/css" rel="stylesheet" href="../css/mui.css" />
		<link type="text/css" rel="stylesheet" href="../css/myadress.css" />
		<link type="text/css" rel="stylesheet" href="../css/iconfont.css" />
		<link href="../css/mui.picker.css" rel="stylesheet" />
    	<link href="../css/mui.poppicker.css" rel="stylesheet" />
		<title></title>
	</head>
	<body>
		<header style="background: #005aab;" class="mui-bar mui-bar-nav head">
			<span class="mui-icon mui-icon-back"></span>
			<h1 style="color: #FFFFFF; letter-spacing: 4px;" class="mui-title">审核未通过业绩</h1>
			<span class="mui-icon mui-icon-more"></span>
		</header>
		<div class="mui-content">
			<div id="xinzeng" class="address">
				<img src="../img/jiahao.png"/>
				<span>新增地址</span>
			</div>
			
			<ul class="mui-table-view">
			    <li class="mui-table-view-cell">北京市海淀区中关村3号</li>
			    <li class="mui-table-view-cell">北京市海淀区中关村3号</li>
			</ul>
		</div>
	</body>
	<script src="../js/jquery1.9.1.js"></script>
	<script src="../js/mui.js"></script>
	<script src="../js/mui.picker.js"></script>
	<script src="../js/mui.poppicker.js"></script>
	<script src="../js/city.data.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/city.data-3.js" type="text/javascript" charset="utf-8"></script>
	<script>
		
		(function($, doc) {
			$.ready(function() {
				mui.init();
				var pickerts='';
				document.getElementById("xinzeng").addEventListener('tap',function(e){
					e.detail.gesture.preventDefault(); //修复iOS 8.x平台存在的bug，使用plus.nativeUI.prompt会造成输入法闪一下又没了
	                var btnArray = ['取消', '确定'];
					var pickers ='<div class="mui-input-row" id="more_input">\
				        <input id="showCityPicker3" style="width: 19%; padding: 0;padding-left: 5px;" type="text" class="mui-input-clear" placeholder="省">\
				        <div class="diqu">省</div>\
				        <input id="showCityPicker2" style="width: 19%; padding: 0;padding-left: 5px;" type="text" class="mui-input-clear" placeholder="市">\
				        <div class="diqu">市</div>\
				        <input id="showCityPicker1" style="width: 19%; padding: 0;padding-left: 5px;" type="text" class="mui-input-clear" placeholder="区">\
				    </div>';
	                mui.prompt(pickers, '请输入详细地址', '添加新地址', btnArray, function(e) {
	                    if (e.index == 1) {
	                    	if(e.value != ''){
	                    		mui.alert(pickerts+e.value, '您输入的地址是')
	                    		//输入成功，发送到服务器
	                    	}else{
	                    		//如果没有输入地址
	                    		mui.toast('请输入您的地址');
	                    		return false
	                    	}
	                    }
	                    document.querySelector('.mui-popup-input input').placeholder='请输入详细地址';
	           		})
                var cityPicker3 = new $.PopPicker({
					layer: 3
				});
				cityPicker3.setData(cityData3);
				var show_sheng = doc.getElementById('showCityPicker1');
				var show_shi=doc.getElementById('showCityPicker2');
				var show_qu=doc.getElementById('showCityPicker3');
				var more_input=document.getElementById("more_input");
				var listinput=more_input.getElementsByClassName("mui-input-clear");
				for(var i=0;i<listinput.length;i++){
					listinput[i].addEventListener('tap',function(event) {
					cityPicker3.show(function(items) {
						pickerts=(items[0] || {}).text +  (items[1] || {}).text + (items[2] || {}).text;
						sheng=(items[0] || {}).text;
						shi=(items[1] || {}).text;
						qu=(items[2] || {}).text;
						if(sheng.indexOf("省")>0){
							show_sheng.value=sheng.substring(0, sheng.lastIndexOf('省'));
						}else{
							show_sheng.value=sheng
						};
						if(show_shi.value.indexOf("市")>0){
							show_shi.value=shi.substring(0, shi.lastIndexOf('市'));
						}else{
							show_shi.value=(items[1] || {}).text;
						};
						if(qu==""){
							show_qu.value=''
						}else{
							show_qu.value=qu
						};
						//返回 false 可以阻止选择框的关闭
//							return false;
					});
				}, false);
				}
				})
			});
		})(mui, document);
	</script>
</html>
